validateDriverNumber

 

Validates an individual's UK Driving Licence Number is correct.

 

Syntax:

validateDriverNumber (string keycode, string licenceNumber)

 


 

Returned data


An object drivingLicence containing the following fields:

 

 

 Property  Type Explanation 
 validity  String  String ‘Valid’ if the licence number is valid.

 String ‘Invalid’ if the licence number not valid. 

 valid  Boolean  True if the Licence Number is Valid, otherwise False
 dob  String  The Licence holder's Date of Birth - as indicated by the Licence number.
 dobDay  String  The Licence holder's day of Date of Birth - as indicated by the Licence number.
 dobMonth  String  The Licence holder's month of Date of Birth - as indicated by the Licence number.
 dobYear  String  The Licence holder's Year of Date of Birth - as indicated by the Licence number.
 gender  String  The Licence holder's gender - as indicated by the Licence number.
 surenameFragment  String  Id the Licence number contains the licence holders surname or a fragment of surname then this is returned back here.
 forenameInitial  String  The initial letter of the licence holders forename.
 middleNameInitial  String  The initial letter of the licence holders middle name - if applicable.
 errorCode  String  Error code of any returning error.
 errorText  String  Textual description of any returning errors.


Supported Versions

Validate Web Service Version 1.x


Errors

1730 The Licence Number is in an incorrect format
1731 The Licence Number is in an incorrect format - incorrect number of digits
1732 The embedded Date of Birth in an invalid date.


Example Code

c#
The following sample show how to use the validateDriverNumber function using c#.
As with all examples, please see the section Adding a reference to the Validate Web Service .

 

c# Example

using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
validateDriverNumber
{
  class
Program
  {
    static void Main(string
[] args)
    {
      string keycode = "qwerty"
;
      string licenceNumber = "ABCD9709100FF9GB"
;
      validate.
validate wsObject = new validate.validate
();
      validate.
drivingLicence
dlnObject = wsObject.validateDriverNumber(keycode,licenceNumber);
      Console
.WriteLine(dlnObject.validity);
      Console
.WriteLine(dlnObject.errorCode);
      Console
.WriteLine(dlnObject.errorText);
      Console
.ReadLine();
    }
  }
}

 

Visual Basic .net
The following sample show how to use the validateDriverNumber function using Visual Basic.net.
As wilth all examples, please see the section Adding a reference to the Validate Web Service .

 

Module Module1
  Sub
Main()

    ' define the keycode and licence number, both as strings.
    Dim keycode As String =
"qwerty"
    Dim licenceNumber As String = "ABCD9709100FF9GB"

    ' Create a web service object
    Dim wsobject As New
validate.validate()

    ' create an object for the returning data
    Dim dlnObject As
validate.drivingLicence

    ' Call the web service function - validateDriverNumber()
    dlnObject = wsobject.validateDriverNumber(keycode, licenceNumber)

    ' display the result or the error message
    Console.WriteLine("The Licence number " & licenceNumber & " is "
& dlnObject.validity)
    Console.WriteLine(dlnObject.errorCode)
    Console.WriteLine(dlnObject.errorText)
    Console.ReadLine()
  End
Sub
End
Module

 

Java
The following sample show how to use the validateDriverNumber using Java.

Java Example

package validatedrivernumber;

public class Main {

    public static void main(String[] args) {
   
        validate.Validate service = new validate.Validate();       
        validate.ValidateSoap port = service.getValidateSoap12();
        java.lang.String keyCode = "qwerty" ;       
        java.lang.String licenceNumber = "ABCD9709100FF9GB" ;
        validate.DrivingLicence result = port.validateDriverNumber(keyCode,licenceNumber);       
        System.out.println( "Licence Number is  " +result.getValidity());       
        System.out.println( "Error Code = " +result.getErrorCode());       
        System.out.println( "Error Message = " +result.getErrorText()); 
    }
}

 


XML Messages

Below is a typical XML message request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:vtes="http://vtest.bemac.com/">
   <soap:Header/>
   <soap:Body>
      <vtes:validateDriverNumber>
         <vtes:keyCode>qwerty </vtes:keyCode>
         <vtes:licenceNumber>ABCD9709100FF9GB </vtes:licenceNumber>
      </vtes:validateDriverNumber>
   </soap:Body>
</soap:Envelope>

 

Below is a typical XML message response

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <validateDriverNumberResponse xmlns="http://vtest.bemac.com/">
         <validateDriverNumberResult>
            <validity>Valid </validity>
            <dob>100970 </dob>
            <dobDay>10 </dobDay>
            <dobMonth>09 </dobMonth>
            <dobYear>70 </dobYear>
            <gender>Male </gender>
            <surnameFragment>ABCD </surnameFragment>
         </validateDriverNumberResult>
      </validateDriverNumberResponse>
   </soap:Body>
</soap:Envelope>


 URL Encoding

Below is an example of using validateDriverNumber via a URL encoded GET request:

  serviceUrl.asmx/dln2.aspx?licence=licenceNumber